package com.cy.ppj.model.enums.wechat;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;

/**
 * @description: 授权类型
 * @author: Ocean
 * @create: 2018-08-06 14:45
 **/
public enum WechatSopce {

    USER_INFO("snsapi_userinfo"),
    BASE("snsapi_base"),
    ;

    @Getter
    private String sopce;

    private static final Map<String, WechatSopce> map = new HashMap<>();

    static {
        Stream.of(WechatSopce.values()).forEach(s -> {
            map.put(s.name(), s);
        });
    }

    WechatSopce(String sopce) {
        this.sopce = sopce;
    }

    public static WechatSopce get(String name) {
        return map.get(name);
    }

}
